package com.xframe.domain.role;


import com.xframe.xdal.core.annotation.*;
import com.xframe.xdal.core.domain.SysBaseEntity;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@Accessors(chain=true)
@XTable(value = "v_menuforuser", label = "用户菜单视图查询",tableType = TableType.View)
@XBelongsTo(typeName = "com.xframe.domain.role.SysMenu",foreignKey = "menuId", targetKey = "menuId", as = "sysMenu")
@XHasMany(typeName = "com.xframe.domain.role.SysMenuConfigs",foreignKey = "menuId", targetKey = "menuId", as = "menuConfigsList")
public class MenuforUser extends SysBaseEntity {



    /**
     * 菜单表ID
     */
    @XColumn(name = "MENU_ID",primaryKeyFlag = true,desc = "菜单ID")
    private Long menuId;

    /**
     * 用户ID
     */
    @XColumn(name = "USER_ID",desc = "用户ID")
    private Long userId;

    /**
     * 系统编码
     */
    @XColumn(name = "SYS_CODE", uniqueFlag = true,desc = "系统编码",length = 20)
    private String sysCode;
    /**
     * 菜单编码
     */
    @XColumn(name = "MENU_CODE", uniqueFlag = true,desc = "菜单编码",length = 20)
    private String code;

    /**
     * 菜单类型
     */
    @XColumn(name = "MENU_TYPE",desc = "菜单类型",length = 20)
    private String menuType;

    private SysMenu sysMenu;

    /**
     * 按钮配置列表
     */
    private List<SysMenuConfigs> menuConfigsList;
}

